package com.zhuzi.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDateTime;

/**
 * @author zhuzi
 * 2022/9/7 15:32
 */

@Slf4j
@RestController
@RequestMapping("conf")
public class PropController {

    @GetMapping("set")
    public LocalDateTime conf(String name) {
        System.setProperty("myconf", name);
        return LocalDateTime.now();
    }

    @GetMapping("get")
    public String getConf(String name) {
        return System.getProperty("myconf", "DEFAULT");
    }

}
